export let cook = {
    setCookie(cname,cvalue,exMinutes){
        var d = new Date();
        d.setTime(d.getTime()+(exMinutes *1000*60));
        var expires = "expires="+d.toGMTString();
        document.cookie = cname + "=" + cvalue + "; " + expires;
    },
    delCookie(cname) {
        document.cookie = cname + "=; " +"expires="+"Thu, 01 Jan 1970 00:00:00 GMT";
    },
    getCookie(cname){
        var name = cname + "=";
        var ca = document.cookie.split(';');
        let returnStr = '';
        for(var i=0; i<ca.length; i++) {
            var c = ca[i].trim();
            if (c.indexOf(name)==0) 
                returnStr = c.substring(name.length,c.length);
        }
        return returnStr;
    }
}
